//
//  ImmediateEvaluationCollectionViewCell.m
//  NewCommunity
//
//  Created by Aaron on 2017/10/16.
//  Copyright © 2017年 ZP. All rights reserved.
//

#import "UploadDataCollectionViewCell.h"

@implementation UploadDataCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _imageView = [[UIImageView alloc]init];
        [self.contentView addSubview:_imageView];
        
        _imageView.sd_layout.leftEqualToView(self.contentView)
//        .topEqualToView(self.contentView)
//        .rightEqualToView(self.contentView)
        .bottomEqualToView(self.contentView)
        .topSpaceToView(self.contentView, 8/WIDTH_6_SCALE)
        .rightSpaceToView(self.contentView, 8/WIDTH_6_SCALE);
        
        _deleteBtn = [[UIButton alloc] init];
        [_deleteBtn setImage:[UIImage imageNamed:@"del_icon"] forState:UIControlStateNormal];
        _deleteBtn.layer.cornerRadius = 8/WIDTH_6_SCALE;
        _deleteBtn.layer.masksToBounds = YES;
        [_deleteBtn addTarget:self action:@selector(deleteBtnClick) forControlEvents:UIControlEventTouchUpInside];
//        [_deleteBtn setTitle:@"x" forState:UIControlStateNormal];
        [self.contentView addSubview:_deleteBtn];
        [_deleteBtn setBackgroundColor:[UIColor redColor]];
        _deleteBtn.sd_layout.topEqualToView(self.contentView)
        .rightEqualToView(self.contentView)
        .widthIs(16/WIDTH_6_SCALE)
        .heightIs(16/WIDTH_6_SCALE);
        
    }
    return self;
}
- (void)deleteBtnClick{
    NSLog(@"删除");
    if (self.deleteImgBlock) {
        self.deleteImgBlock();
    }
}
@end
